package com.zerui.manager.openplan.domainservice;

import com.zerui.manager.openplan.task.OpenPlanDelayTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.concurrent.DelayQueue;

/**
 * @Author wh
 * @create_time 2023-08-23 11:07
 */
@Slf4j
@Component
public class OpenPlanTask {

    @Resource
    private DelayQueue<OpenPlanDelayTask> openPlanDelayQueue;

    public void addTsk(Long implementId, long operationTime)  {
        //添加到延迟队列
        log.info("开门计划添加到延迟队列：{},时间：{}",implementId,operationTime);
        openPlanDelayQueue.add(
                new OpenPlanDelayTask(implementId,operationTime)
        );
    }

}
